package com.sansecy.video.player;

import android.content.Context;

import com.google.android.exoplayer2.DefaultRenderersFactory;
import com.google.android.exoplayer2.RenderersFactory;
import com.sansecy.video.player.factory.SpRenderersFactory;

public class ExoPlayerUtil {
    public static RenderersFactory buildRenderersFactory(
            Context context) {
        return new SpRenderersFactory(context.getApplicationContext())
                .setExtensionRendererMode(DefaultRenderersFactory.EXTENSION_RENDERER_MODE_PREFER);
    }

//    public static SimpleExoPlayer createPlayer(Context context) {
//        DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(context);
//        MediaSource mediaSource;
//        mediaSource =
//                new ProgressiveMediaSource.Factory(dataSourceFactory)
//                        .createMediaSource();
//        SimpleExoPlayer player = new SimpleExoPlayer.Builder(getApplicationContext()).build();
//        player.setMediaSource(mediaSource);
//        player.prepare();
//        player.play();
//        player.setRepeatMode(Player.REPEAT_MODE_ALL);
//    }
}
